---
feature_name: new.target
chrome_version: 46
feature_id: 5210159227863040
---

<h3>Background</h3>
<p>
  The <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-meta-properties-runtime-semantics-evaluation"><code>new.target</code></a>
  value is part of the ES2015 (formerly known as ES6) specification, and can take one of two values:
</p>
<ul>
  <li>
    Inside of a constructor, <code>new.target</code> is set to a reference to the constructor that
    was used when calling <code>new</code>.
  </li>
  <li>
    Inside of a normal function, <code>new.target</code> is set to <code>undefined</code>.
  </li>
</ul>
<p>
  <code>new.target</code> is useful for distinguishing at runtime whether code is being executed as
  a constructor or as a function. It is also handy as a way to determine the specific subclass
  that was used with <code>new</code> from within a superclass constructor.
</p>

{% include output_helper.html %}

{% include js_snippet.html filename='demo.js' %}
